package main

import "fmt"

func main() {
	arr:=[...]int{0,1,2,3,4,5,6,7}
	s2:=arr[:]
	s:=arr[2:5]
	fmt.Println(s)

	updateSlice(s)
	fmt.Println("修改后")
	fmt.Println(s)


	fmt.Println("重复赋值前：")
	fmt.Println(s2)
	s2=s2[:5]
	fmt.Println("重复赋值1：")
	fmt.Println(s2)
	s2=s2[2:]
	fmt.Println("重复赋值2：")
	fmt.Println(s2)
}

func updateSlice(s []int){
	fmt.Println("修改前：")
	fmt.Println(s)
	s[0]=100
}